# Contributor: Marian Buschsieweke <marian.buschsieweke@posteo.net>
maintainer="Marian Buschsieweke <marian.buschsieweke@posteo.net>"
pkgname=py3-okonomiyaki
_pkgname=okonomiyaki
pkgver=2.0.0
pkgrel=0
pkgdesc="low-level code used for Enthought's eggs and python runtimes"
url="https://github.com/enthought/okonomiyaki"
license="BSD-3-Clause"
arch="all"
depends="
	py3-attrs
	py3-distro
	py3-jsonschema
	py3-parameterized
	py3-six
	py3-zipfile2
	python3
	"
makedepends="
	py3-gpep517
	py3-installer
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-hypothesis
	py3-mock
	py3-pytest
	py3-testfixtures
	"
subpackages="
	$pkgname-pyc
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/enthought/okonomiyaki/archive/refs/tags/$pkgver.tar.gz
	"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages "$srcdir"/testenv
	"$srcdir"/testenv/bin/python3 -m installer dist/*.whl

	PATH="$srcdir/testenv/bin:$PATH" "$srcdir"/testenv/bin/python3 \
		-m pytest -v \
		--deselect okonomiyaki/runtimes/tests/test_runtime.py::TestPythonRuntime::test_simple_from_running_python
}

package() {
	python3 -m installer -d "$pkgdir" \
		"$builddir"/dist/*.whl
}

sha512sums="
65f416075f6fa435c70dcb45a2bce358424e6a7cc2493fae5dce1c0071c870d681e50cb6dde054a5164f5eb1c24ba70437b9205ce54503c4ea6b8747f92a11e7  py3-okonomiyaki-2.0.0.tar.gz
"
